home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Games / WHDLoad / Src / imager-examples / Lotus2.islave.asm < prev    next >
Encoding:
Assembly Source File  |  2001-09-18  |  4.6 KB  |  178 lines

  1. ;*---------------------------------------------------------------------------
  2. ;  :Program.    lotus.islave.asm
  3. ;  :Contents.    Imager for Lotus
  4. ;  :Author.    Wepl
  5. ;  :Version.    $Id: Lotus2.islave.asm 1.2 2000/07/27 20:08:44 jah Exp jah $
  6. ;  :History.    22.08.99 transformed from lotus imager
  7. ;        09.09.99 support for lotus triology version added
  8. ;        08.07.00 NextSync added
  9. ;  :Requires.    -
  10. ;  :Copyright.    Public Domain
  11. ;  :Language.    68000 Assembler
  12. ;  :Translator.    Barfly V2.9
  13. ;  :To Do.
  14. ;---------------------------------------------------------------------------*
  15. ;
  16. ;    Disk format:
  17. ;    original release:
  18. ;    Disk 1:        0-1    standard
  19. ;            2-157    $1800 bytes sync=4489
  20. ;            158-159 sync=41244124 protection long track (>2*$1900)
  21. ;    Amiga Fun rerelease:
  22. ;    Disk 1:        0-159    standard
  23. ;    Lotus Triology release:
  24. ;    Disk 1:        0-1    standard
  25. ;            2-157    $1800 bytes sync=4489
  26. ;            158-159 sync=41244124 protection long track (>2*$1900)
  27. ;
  28. ;---------------------------------------------------------------------------*
  29.  
  30.     INCDIR    Includes:
  31.     INCLUDE    RawDic.i
  32.  
  33.     IFD BARFLY
  34.     OUTPUT    "Develop:Installs/Lotus2 Install/Lotus2.ISlave"
  35.     BOPT    O+            ;enable optimizing
  36.     BOPT    OG+            ;enable optimizing
  37.     BOPT    ODd-            ;disable mul optimizing
  38.     BOPT    ODe-            ;disable mul optimizing
  39.     ENDC
  40.  
  41. ;============================================================================
  42.  
  43.     SECTION a,CODE
  44.  
  45.         SLAVE_HEADER
  46.         dc.b    1        ; Slave version
  47.         dc.b    0        ; Slave flags
  48.     ;    dc.b    SFLG_DEBUG    ; Slave flags
  49.         dc.l    _disk1        ; Pointer to the first disk structure
  50.         dc.l    _text        ; Pointer to the text displayed in the imager window
  51.  
  52.         dc.b    "$VER: "
  53. _text        dc.b    "Lotus2 Imager",10
  54.         dc.b    "Done by Wepl, Version 1.1 "
  55.     DOSCMD    "WDate >T:date"
  56.     INCBIN    "T:date"
  57.         dc.b    ".",0
  58.     EVEN
  59.  
  60. ;============================================================================
  61.  
  62.     ;original release
  63. _disk1        dc.l    0        ; Pointer to next disk structure
  64.         dc.w    1        ; Disk structure version
  65.         dc.w    DFLG_SWAPSIDES|DFLG_NORESTRICTIONS    ; Disk flags
  66.         dc.l    _tl1        ; List of tracks which contain data
  67.         dc.l    0        ; UNUSED, ALWAYS SET TO 0!
  68.         dc.l    _fl1        ; List of files to be saved
  69.         dc.l    _crc1        ; Table of certain tracks with CRC values
  70.         dc.l    _disk12        ; Alternative disk structure, if CRC failed
  71.         dc.l    0        ; Called before a disk is read
  72.         dc.l    0        ; Called after a disk has been read
  73.  
  74. _tl1        TLENTRY    1,1,$1600,SYNC_STD,DMFM_STD
  75.         TLENTRY    0,0,$1600,SYNC_STD,DMFM_STD
  76.         TLENTRY    2,157,$1800,$4489,_decode1
  77.         TLEND
  78.  
  79. _fl1        FLENTRY    FL_DISKNAME,0,FL_DISKLENGTH
  80.         FLEND
  81.  
  82. _crc1        CRCENTRY 1,$aff2
  83.         CRCEND
  84.  
  85.     STRUCTURE disk,0
  86.         LONG    disk_id            ;"LETC"
  87.         STRUCT    disk_offsets,256*4    ;start-offset of each file
  88.         LONG    disk_end        ;end of disk
  89.         STRUCT    disk_chain,256        ;number of following file
  90.         LONG    disk_jmp        ;jump address of first file
  91.         STRUCT    disk_name,64        ;name of disk
  92.         LABEL    disk_data
  93.  
  94. _decode1
  95.  
  96. .search        cmp.w    #$5555,(a0)+
  97.         beq    .go
  98.         jsr    (rawdic_NextSync,a5)
  99.         tst.l    d0
  100.         bne    .search
  101.         moveq    #IERR_CHECKSUM,d0
  102.         rts
  103.  
  104. .go        move.w    #$bff,d7
  105.         move.w    #$5555,d2
  106.         moveq    #0,d3
  107.         move.w    d0,d4
  108.  
  109. .loop        bsr    .get
  110.         move.w    d1,(a1)+
  111.         add.w    d1,d3
  112.         dbf    d7,.loop
  113.  
  114.         bsr    .get
  115.         cmp.w    d1,d3
  116.         bne    .search
  117.         
  118.         cmp.w    #2,d4            ;first image track?
  119.         bne    .ok
  120.         move.l    (disk_end-$1800,a1),d0
  121.         sub.l    #$3000-$2c00,d0        ;because contain track 1&2 are only $1600
  122.         move.l    d0,(_fl1+8)        ;image size
  123.  
  124. .ok        moveq    #IERR_OK,d0
  125.         rts
  126.  
  127. .get        move.w    (a0)+,d0
  128.         move.w    (a0)+,d1
  129.         and.w    d2,d0
  130.         and.w    d2,d1
  131.         add.w    d1,d1
  132.         add.w    d0,d1
  133.         rts
  134.  
  135. ;============================================================================
  136.  
  137.     ;amiga fun rerelease
  138. _disk12        dc.l    0        ; Pointer to next disk structure
  139.         dc.w    1        ; Disk structure version
  140.         dc.w    0        ; Disk flags
  141.         dc.l    _tl12        ; List of tracks which contain data
  142.         dc.l    0        ; UNUSED, ALWAYS SET TO 0!
  143.         dc.l    _fl12        ; List of files to be saved
  144.         dc.l    _crc12        ; Table of certain tracks with CRC values
  145.         dc.l    _disk13        ; Alternative disk structure, if CRC failed
  146.         dc.l    0        ; Called before a disk is read
  147.         dc.l    0        ; Called after a disk has been read
  148.  
  149. _tl12        TLENTRY    0,159,$1600,SYNC_STD,DMFM_STD
  150.         TLEND
  151.  
  152. _fl12        FLENTRY    FL_DISKNAME,0,FL_DISKLENGTH
  153.         FLEND
  154.  
  155. _crc12        CRCENTRY 0,$20c4
  156.         CRCEND
  157.  
  158. ;============================================================================
  159.  
  160.     ;lotus triology rerelease
  161. _disk13        dc.l    0        ; Pointer to next disk structure
  162.         dc.w    1        ; Disk structure version
  163.         dc.w    DFLG_SWAPSIDES|DFLG_NORESTRICTIONS    ; Disk flags
  164.         dc.l    _tl1        ; List of tracks which contain data
  165.         dc.l    0        ; UNUSED, ALWAYS SET TO 0!
  166.         dc.l    _fl1        ; List of files to be saved
  167.         dc.l    _crc13        ; Table of certain tracks with CRC values
  168.         dc.l    0        ; Alternative disk structure, if CRC failed
  169.         dc.l    0        ; Called before a disk is read
  170.         dc.l    0        ; Called after a disk has been read
  171.  
  172. _crc13        CRCENTRY 1,$a553
  173.         CRCEND
  174.  
  175. ;============================================================================
  176.  
  177.     END
  178.